package com.x.service.entity.map;

import com.x.service.entity.BookList;
import com.x.service.entity.BookListsBean;
import com.x.zssqservice.bean.RecommendBookList;

import java.util.ArrayList;

/**
 * Created by H on 18/5/9.
 */

public class RecommendLstTpBookList implements IMap<RecommendBookList, BookList> {
    @Override
    public BookList map(RecommendBookList recommendBookList) {
        BookList bookList = new BookList();
        bookList.books = new ArrayList<>();
        bookList.ok = recommendBookList.ok;
        for (RecommendBookList.RecommendBook recommendBook : recommendBookList.booklists) {
            BookListsBean bookListsBean = new BookListsBean();
            bookListsBean._id = recommendBook.id;
            bookListsBean.title = recommendBook.title;
            bookListsBean.author = recommendBook.author;
            bookListsBean.cover = IMG_BASE_URL + recommendBook.cover;
            bookListsBean.shortIntro = recommendBook.desc;
            bookListsBean.updated = recommendBook.updated;
//            bookListsBean.lastChapter = recommendBook.;
//            bookListsBean.latelyFollower = recommendBook.;
//            bookListsBean.majorCate = recommendBook.;
//            bookListsBean.minorCate = recommendBook.id;
//            bookListsBean.isSerial = recommendBook.;
            bookList.books.add(bookListsBean);
        }
        return bookList;
    }
}
